<template>
    <div>
        <h3>当前最新的count值为: {{count}}</h3>
        <button @click="sub()">-1</button>
        <button @click="subN(3)">-n</button>
        <button @click="subAsync">-1 async</button>
        <button @click="subNAsync(5)">-n async</button>


    </div>
</template>
<script>
import {mapState,mapMutations,mapActions} from 'vuex'

export default {
    data(){
        return{

        }
    },
    computed:{
        // 映射  
        ...mapState(['count'])
    },
    methods:{
        ...mapMutations(['sub','subN']),
        ...mapActions(['subAsync','subNAsync'])
    }
}
</script>
<style lang="less" scoped>

</style>